var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, o, n) {
    var a, r = arguments.length, i = r < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(e, t, o, n); else for (var c = e.length - 1; 0 <= c; c--) (a = e[c]) && (i = (r < 3 ? a(i) : 3 < r ? a(t, o, i) : a(t, o)) || i);
    return 3 < r && i && Object.defineProperty(t, o, i), i;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("HeadView"), s = e("GameManager"), c = cc._decorator, l = c.ccclass, d = c.property, u = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.blue = null, e.red = null, e.headView = null, e.animation = null, e;
    }
    return i(e, t), e.prototype.start = function() {}, e.prototype.init = function() {
        var n = this;
        s.default.getInstance().model.players.forEach(function(e, t) {
            var o = cc.instantiate(n.headView.node);
            o.getComponent(r.default).init(e.icon, e.nickname, e.personIdx), o.active = !0, 
            o.parent = e.group == s.default.getInstance().model.curPlayer.group ? n.blue : n.red, 
            o.setPosition(cc.v2(t % 3 * 150 - 150, 10));
        });
    }, e.prototype.doEffect = function() {
        s.default.getInstance().gameView.followCamera.zoomRatio = .4, this.animation.play();
    }, e.prototype.update = function(e) {
        var t = s.default.getInstance().gameView;
        t.followCamera.zoomRatio < .8 ? t.followCamera.zoomRatio += e / 4 * .4 : .8 != t.followCamera.zoomRatio && (t.followCamera.zoomRatio = .8);
    }, a([ d(cc.Node) ], e.prototype, "blue", void 0), a([ d(cc.Node) ], e.prototype, "red", void 0), 
    a([ d(r.default) ], e.prototype, "headView", void 0), a([ d(cc.Animation) ], e.prototype, "animation", void 0), 
    a([ l ], e);
}(cc.Component);

n.default = u;